package cn.autumnorange.app.money.provider.rest;

import cn.autumnorange.app.common.dto.ResultDto;
import cn.autumnorange.app.money.api.MoneyService;
import cn.autumnorange.app.money.api.dto.MoneyDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class SysMoneyRest implements MoneyService {
  @Autowired private MoneyService moneyService;

  @Value("${server.port}")
  private int port;

  @Override
  public ResponseEntity<ResultDto<MoneyDto>> add(
      @PathVariable(value = "version") Long version, @PathVariable(value = "money") Long money) {
    return moneyService.add(version, money);
  }

  @Override
  public ResultDto<MoneyDto> getmoney() {
    return null;
  }

  @Override
  public ResponseEntity<ResultDto<MoneyDto>> resetacc() {
    return moneyService.resetacc();
  }

  @Override
  public ResponseEntity<ResultDto<Long>> getVersion(Long id) {
    return moneyService.getVersion(id);
  }

  //  @RPCIdempotentLockTarget()

}
